<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.2/css/swiper.css">
    <title>原神</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #bgc{
            position: relative;
            width: 100%;
            height: 100vh;
            overflow: hidden;
        }
        .swiper-slide img{
            transition:1s linear 2s;
            transform:scale(1.1,1.1);
        }
        .swiper-slide-active img,.swiper-slide-duplicate-active img{
            transition:6s linear;
            transform:scale(1,1);
        }
        .character__sidebar{
            position: absolute;
            z-index: 9;
            top: 0;
            left: 0;
            width: 370px;
            height: 100%;
            box-sizing: border-box;
            padding-top: 187px;
        }
        .character__sidebar::before {
            position: absolute;
            top: 0;
            left: 37px;
            display: block;
            content: '';
            width: 2px;
            height: 1280px;
            background: rgba(255, 255, 255, 0.14);
        }
        *, *::before, *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        }
        .character__city {
            width: 100%;
            height: 54px;
            line-height: 54px;
            font-size: 18px;
            color: #fff;
            text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
            box-sizing: border-box;
            padding-left: 56px;
            cursor: pointer;
            background: 18px center no-repeat;
            background-image: url('img/nav_left2.png');
            background-size: 40px;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }
        .character__city--active {
            text-shadow: none;
            padding-left: 70px;
            background: left center no-repeat;
            background-image: url('img/nav_left1.png');
            background-size: contain;
        }
        .character__city--disable {
            pointer-events: none;
        }
        .character__main {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: url('img/6c9d197.png') no-repeat;
            background-position: center bottom;
            background-size: auto 100vh;
            z-index: 1;
        }
        .character__title{
            position: relative;
            z-index: 2;
            height: 100%;            
        }
        .character__person {
            position: absolute;
            top: 0;
            left: calc(50% - 63vh);
            width: auto;
            height: 100vh;
            opacity: 1;
            -webkit-transform: translateX(500px);
            transform: translateX(500px);
            transition: all 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
        }
        .swiper-slide-active .character__person, .swiper-slide-active .character__content {
            opacity: 1;
            -webkit-transform: translateX(0);
            transform: translateX(0);
        }
       
        .character__icon {
            position: absolute;
            top: 10vh;
            left: calc(50% - 60vh);
            width: auto;
            height: 378px;
            opacity: 0.1;
        }
        .character__content {
            position: absolute;
            z-index: 4;
            top: 18vh;
            left: calc(50% - 53vh);
            width: 550px;
            -webkit-transform: translateX(-300px);
            transform: translateX(-300px);
            transition: all 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
            text-align: justify;
        }
        @media screen and (max-width: 1640px){
            .character__icon {
                left: calc(50% - 50vh);
            }
            .character__content {
                left: calc(50% - 43vh);
            }

        }
        .character__name {
            width: 50vh;
            height: auto;
            margin-top: 20px;
        }
        .character__cv {
            position: relative;
            display: flex;
            width: 315px;
            height: 54px;
            font-size: 24px;
            color: #24333c;
            line-height: 54px;
            padding-left: 60px;
            box-sizing: border-box;
            background: #cca574 url('img/swiper2.1.jpg') no-repeat;
            background-position: left top;
            background-size: 54px;
            margin-top: -10px;
            box-shadow: 2px 3px 6px 0 rgba(12, 12, 12, 0.2);
        }
        .character__voice {
            position: absolute;
            top: -5px;
            right: -5px;
            width: 64px;
            height: 64px;
            background-image: url('img/swiper_main1.5.png');
            background-repeat: no-repeat;
            background-position: center;
            background-size: 64px;
            cursor: pointer;
        }
        .character__switch--wrap {
            position: absolute;
            top: 11px;
            right: -120px;
            width: 80px;
            height: 32px;
            border-radius: 16px;
            border: 2px solid rgba(255, 255, 255, 0.1);
            box-sizing: content-box;
        }
        .character__switch {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            height: 100%;
            padding: 0 4px;
            box-sizing: border-box;
            background: rgba(18, 18, 18, 0.6);
            border-radius: 16px;
            cursor: pointer;
        }
        .character__sbtn {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: #dbb17d;
            color: #dbb17d;
            font-size: 0;
            text-align: center;
            line-height: 26px;
        }
        
        .character__sbtn {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: #dbb17d;
            color: #dbb17d;
            font-size: 0;
            text-align: center;
            line-height: 26px;
        }
        .character__sbtn--active{
            background: none;
            font-size: 20px;
        }
        .character__sen {
            position: absolute;
            top: 62vh;
            left: calc(50% - 26vh);
            opacity: 1;
            transition: opacity 1s cubic-bezier(0.215, 0.61, 0.355, 1) 0.3s;
            -webkit-transform: scale(1.2);
            transform: scale(1.2);
            -webkit-transform-origin: left center;
            transform-origin: left center;
        }
        .character__intro {
            display: flex;
            width: 100%;
            min-height: 26px;
            max-height: 150px;
            overflow-y: auto;
            padding: 10px 0 10px 15px;
            box-sizing: border-box;
            background: rgba(1, 1, 1, 0.5);
            font-size: 16px;
            color: #fff;
            margin-top: 17px;
            line-height: 26px;
        }
        .character__intro::before {
            flex-shrink: 0;
            display: block;
            content: '';
            width: 20px;
            height: 20px;
            background: url('img/swiper_main1.6.png') center no-repeat;
            background-size: 20px;
            margin-right: 24px;
            margin-top: 4px;
        }
        .character__intro-content {
            width: 455px;
        }
        .swiper-container2{
            position: relative;
            overflow: hidden;
            z-index: 1;
            height: 100%;
        }
        .character__swiper--page {
            position: absolute;
            z-index: 4;
            left: 50%;
            bottom: 0;
            padding-top: 22px;
            width: 100%;
            height: 190px;
            background: rgba(204, 204, 204, 0.2);
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            transform: translate(-50%,0)
        }
        .character__swiper--page .swiper-wrapper {
            overflow: hidden;
            top: 0;
            bottom: 0;
            margin: 0 auto;
            width: 100%;
            height: 150px;
            justify-content: center;
        }
        .character__swiper--page .character__page--render li{
            float: left;
            margin-right: 35px;
            list-style: none;
            text-align: center;
            
        }
        .character__swiper--page li {
            margin-right: 34px;
            width: 110px;
            height: 132px;
            background: transparent url('img/swiper_icon_bgc.png') no-repeat 0 0;
            font-size: 0;
            cursor: pointer;
        }
        .character__swiper--page li:hover{
            background-position: 0 -132px;
        }
        .character__swiper--page li a:hover p{
            color: #000;
        }
        .character__swiper--page li a{
            text-decoration: none;
            display: inline-block;
        }
        .character__swiper--page img {
            display: block;
            margin: 2px auto 0;
            width: 106px;
            height: 106px;
        }
        .character__swiper--page p {
            font-size: 16px;
            line-height: 22px;
            color: #fff;
            text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
            text-align: center;
        }
        .character__swiper--page .swiper-slide:hover, .character__swiper--page .swiper-slide-active {
            background-position: 0 -132px;
        }
        .character__swiper--page .swiper-slide-active p{
            color: #000;
        }
        .clearfix::after {
            content: '';
            display: block;
            clear: both;
        }
        .character__page--render{
            position: absolute;
            left: 50%;
            transform: translate(-50%,0);
            z-index: 8;
            width: auto;
        }
    </style>
</head>

<body>
    <div id="bgc">
        <!-- 背景图 -->
        <div class="swiper-container">
                <div class="swiper-wrapper">
                    <div class="swiper-slide"><img src="img/b1.jpg" alt=""></div>
                    <div class="swiper-slide"><img src="img/b2.jpg" alt=""></div>
                </div>
        </div>
        <!-- 左边导航   蒙德城 -->
        <ul class="character__sidebar">
            <li class="character__city character__city--active">蒙德城</li>
            <li class="character__city character__city--disable" >璃月港</li>
            <li class="character__city character__city--disable">敬请期待</li>
        </ul>
        <!-- 中间人物内容 -->
        <div class="character__main">
            <div class="character__title">
                <div class="swiper-container2">
                        <div class="swiper-wrapper">
                            <div class="swiper-slide " data-hash="slide1" >
                                <img src="img/swiper_main1.1.png" draggable="false" alt="character_person" class="character__person"> 
                                <img src="img/swiper_main1.2.png" draggable="false" alt="character_icon" class="character__icon"> 
                                <div data-swiper-parallax-opacity=".1" data-swiper-parallax-duration=".5" class="character__content">
                                    <img src="img/swiper_main1.3.png" draggable="false" alt="character_name" class="character__name"> 
                                    <div class="character__cv">
                                        <span class="character__cv_name_china">CV:&nbsp;林簌</span>
                                        <span class="character__cv_name_japan" style="display: none">CV:&nbsp;斋藤千和</span>
                                    <div class="character__voice">

                                    </div> 
                                    <div class="character__voice character__voice--active" style="display: none;">
                                    </div> 
                                    <div class="character__switch--wrap">
                                        <div class="character__switch">
                                            <p class="character__sbtn">日</p> 
                                            <p class="character__sbtn character__sbtn--active">中</p>
                                        </div>
                                    </div>
                                    </div> 
                                    <div class="character__intro">
                                        <div class="character__intro-content">
                                            <p>在西风骑士团里，凯亚是代理团长最信任的副手。凡是交托于他的任务，总能得到解决。</p>
                                            <p>在蒙德城中，风趣幽默的他同样深受人们的喜爱，然而这位谈吐不凡的骑士隐约有着什么不为人知的秘密。</p>
                                        </div>
                                    </div>
                                </div> 
                                <img src="img/swiper_main1.4.png" draggable="false" alt="character_sen" class="character__sen">
                            </div>
                            <div class="swiper-slide  " data-hash="slide2">
                                    <img src="img/swiper_main2.1.png" draggable="false" alt="character_person" class="character__person"> 
                                    <img src="img/swiper_main2.2.png" draggable="false" alt="character_icon" class="character__icon"> 
                                    <div data-swiper-parallax-opacity=".1" data-swiper-parallax-duration=".5" class="character__content">
                                        <img src="img/swiper_main2.3.png" draggable="false" alt="character_name" class="character__name"> 
                                        <div class="character__cv">
                                            <span class="character__cv_name_china">CV:&nbsp;牛奶君</span>
                                            <span class="character__cv_name_japan" style="display: none">CV:&nbsp;石见舞菜香</span>
                                        <div class="character__voice">
    
                                        </div> 
                                        <div class="character__voice character__voice--active" style="display: none;">
                                        </div> 
                                        <div class="character__switch--wrap">
                                            <div class="character__switch">
                                                <p class="character__sbtn">日</p> 
                                                <p class="character__sbtn character__sbtn--active">中</p>
                                            </div>
                                        </div>
                                        </div> 
                                        <div class="character__intro">
                                            <div class="character__intro-content">
                                                <p>活泼率直的少女，是蒙德城中唯一的侦察骑士。</p>
                                                <p>擅长使用滑翔翼的安柏，连续三年蝉联蒙德城的「飞行冠军」。</p>
                                                <p>作为西风骑士团的新星，今天的安柏依然活跃在第一线。</p>
                                            </div>
                                        </div>
                                    </div> 
                                    <img src="img/swiper_main2.4.png" draggable="false" alt="character_sen" class="character__sen">
                            </div>
                            <div class="swiper-slide  " data-hash="slide3">
                                    <img src="img/swiper_main3.1.png" draggable="false" alt="character_person" class="character__person"> 
                                    <img src="img/swiper_main3.2.png" draggable="false" alt="character_icon" class="character__icon"> 
                                    <div data-swiper-parallax-opacity=".1" data-swiper-parallax-duration=".5" class="character__content">
                                        <img src="img/swiper_main3.3.png" draggable="false" alt="character_name" class="character__name"> 
                                        <div class="character__cv">
                                            <span class="character__cv_name_china">CV:&nbsp;钟可</span>
                                            <span class="character__cv_name_japan" style="display: none">CV:&nbsp;田中理惠</span>
                                        <div class="character__voice">
    
                                        </div> 
                                        <div class="character__voice character__voice--active" style="display: none;">
                                        </div> 
                                        <div class="character__switch--wrap">
                                            <div class="character__switch">
                                                <p class="character__sbtn">日</p> 
                                                <p class="character__sbtn character__sbtn--active">中</p>
                                            </div>
                                        </div>
                                        </div> 
                                        <div class="character__intro">
                                            <div class="character__intro-content">
                                                <p>她是钟情于睡眠的知性魔女。</p>
                                                <p>作为西风骑士团图书馆的管理员，聪明的丽莎总能以最有效的方式将遇到的问题统统解决。</p>
                                                <p>虽然看似慵懒，但处变不惊的她似乎早已将一切尽数掌控。</p>
                                            </div>
                                        </div>
                                    </div> 
                                    <img src="img/swiper_main3.4.png" draggable="false" alt="character_sen" class="character__sen">
                            </div>
                            <div class="swiper-slide  " data-hash="slide4">
                                    <img src="img/swiper_main4.1.png" draggable="false" alt="character_person" class="character__person"> 
                                    <img src="img/swiper_main4.2.png" draggable="false" alt="character_icon" class="character__icon"> 
                                    <div data-swiper-parallax-opacity=".1" data-swiper-parallax-duration=".5" class="character__content">
                                        <img src="img/swiper_main4.3.png" draggable="false" alt="character_name" class="character__name"> 
                                        <div class="character__cv">
                                            <span class="character__cv_name_china">CV:&nbsp;孙晔</span>
                                            <span class="character__cv_name_japan" style="display: none">CV:&nbsp;鸟海浩辅</span>
                                        <div class="character__voice">
    
                                        </div> 
                                        <div class="character__voice character__voice--active" style="display: none;">
                                        </div> 
                                        <div class="character__switch--wrap">
                                            <div class="character__switch">
                                                <p class="character__sbtn">日</p> 
                                                <p class="character__sbtn character__sbtn--active">中</p>
                                            </div>
                                        </div>
                                        </div> 
                                        <div class="character__intro">
                                            <div class="character__intro-content">
                                                <p>在西风骑士团里，凯亚是代理团长最信任的副手。凡是交托于他的任务，总能得到解决。</p>
                                                <p>在蒙德城中，风趣幽默的他同样深受人们的喜爱，然而这位谈吐不凡的骑士隐约有着什么不为人知的秘密。</p>
                                            </div>
                                        </div>
                                    </div> 
                                    <img src="img/swiper_main4.4.png" draggable="false" alt="character_sen" class="character__sen">
                            </div>
                        </div>
                        <div class="character__swiper--page">
                            <ul class="character__page--render swiper-pagination-custom clearfix">
                                <li class=" swiper-slide-active">
                                    <a href="#slide1"><img src="img/swiper_icon1.png" draggable="false" alt="头像"> <p>琴</p></a>
                                </li>
                                <li class="">
                                    <a href="#slide2"><img src="img/swiper_icon2.png" draggable="false" alt="头像"> <p>安柏</p></a>
                                </li>
                                <li class="">
                                    <a href="#slide3"><img src="img/swiper_icon3.png" draggable="false" alt="头像"> <p>丽莎</p></a>
                                </li>
                                <li class="">
                                    <a href="#slide4"><img src="img/swiper_icon4.png" draggable="false" alt="头像"> <p>凯亚</p></a>
                                </li>
                            </ul>
                        </div>
                </div>
                
            </div>
        </div>
    
    </div>
    <div>
        这是底部
    </div>
</body>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.2/js/swiper.min.js"></script>
<script language="javascript"> 
    var mySwiper = new Swiper('.swiper-container',{
        autoplay:  {
            delay: 4000,//4秒切换一次
        },
        loop : true,//自动播放
        effect : 'fade',//切换效果
        fadeEffect: {
            crossFade: true,//
        },
        
    })
    var mySwiper2 = new Swiper('.swiper-container2',{
        loop:true,
        hashNavigation: {
            watchState: true,
        },
        effect : 'fade',//淡入淡出切换效果
        fadeEffect: {
            crossFade: true,//
        },
        on: {
            slideChangeTransitionStart: function(){
                $('.character__page--render li').each((index,item)=>{
                    if(this.activeIndex ==index+1){//this.activeIndex  表示当前轮播是哪一张  需要对应
                        if(!$(item).hasClass('swiper-slide-active')){
                            $(item).siblings().removeClass('swiper-slide-active');
                            $(item).addClass('swiper-slide-active');
                        }
                    }
                    if(this.activeIndex ==5&&index ==0){//第五张图和第一张是一样的 
                        if(!$(item).hasClass('swiper-slide-active')){
                            $(item).siblings().removeClass('swiper-slide-active');
                            $(item).addClass('swiper-slide-active');
                        }
                    }
                })
            },
        },
    })
    $('.character__switch').on('click',function(){
        if($(this).find('p:nth-of-type(1)').hasClass('character__sbtn--active')){
            $(this).find('p:nth-of-type(1)').removeClass('character__sbtn--active');
            $(this).find('p:nth-of-type(2)').addClass('character__sbtn--active');
            $('.character__cv_name_china').show();
            $('.character__cv_name_japan').hide();
        }else{
            $(this).find('p:nth-of-type(1)').addClass('character__sbtn--active');
            $(this).find('p:nth-of-type(2)').removeClass('character__sbtn--active');
            $('.character__cv_name_japan').show();
            $('.character__cv_name_china').hide();
        }
    })

    $('.character__page--render').on('click','li',function(){
        if(!$(this).hasClass('swiper-slide-active')){
            $(this).siblings().removeClass('swiper-slide-active');
            $(this).addClass('swiper-slide-active');
        }
    })
</script>

</html>